package experiment;

import java.util.HashMap;
import java.util.Map;

public class ViewMemSize {
     public static void main(String args[]){
         long start = 0;
         long end = 0;
         System.out.println("int:"+sizeof(start));
         // 先垃圾回收
         System.gc();
         start = Runtime.getRuntime().freeMemory();

         Map<String, Object> res = new HashMap<String, Object>();


         end = Runtime.getRuntime().freeMemory();
         System.out.println("对象内存:" + (start - end)/1000.0 + " KB");

     }
}
